import { createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            component: () => import('../views/layout/LayoutPage.vue'),
            redirect: '/home',
            meta: { title: '工作台' },
            children: [
                {
                    path: 'home',
                    component: () => import('../views/home/Index.vue'),
                },
            
                {
                    path: 'myExam',
                    component: () => import('../views/myExam/Index.vue'),
                    meta: { title: '正式考试' },
                    children: [
                       
                    ]
                },
                {
                    path: 'mockExam',
                    component: () => import('../views/mockExam/Index.vue'),
                    meta: { title: '模拟考试' },
                    children: [
                       
                    ]
                },
                {
                    path: 'myExer',
                    component: () => import('../views/myExer/Index.vue'),
                    meta: { title: '专项练习' },
                    children: [
                       
                    ]
                },
                {
                    path: 'myBaseExer',
                    component: () => import('../views/myBaseExer/Index.vue'),
                    meta: { title: '基础练习' },
                    children: [
                       
                    ]
                },
                {
                    path: 'myCollect',
                    component: () => import('../views/myCollect/Index.vue'),
                    meta: { title: '我的收藏' },
                    children: [
                       
                    ]
                },
                {
                    path: 'myErr',
                    component: () => import('../views/myErr/Index.vue'),
                    meta: { title: '我的错题' },
                    children: [
                       
                    ]
                },
                {
                    path: 'search',
                    component: () => import('../views/search/search.vue'),
                    meta: { title: '搜索' },
                    children: [
                       
                    ]
                },
                {
                    path: 'fileList',
                    component: () => import('../views/fileList/index.vue'),
                    meta: { title: '资料库' },
                    children: [
                       
                    ]
                },
            ],
        },
        {
            path: '/login',
            component: () => import('../views/login/login.vue'),
        },
        {
            path: '/paper',
            component: () => import('../views/layout/footer.vue'),
            children: [
                {
                    path: '/myExer/paper/:exerId',
                    component: () => import('../views/myExer/Paper.vue'),
                    meta: { title: '专项试题' },
                },
                {
                    path: '/myBaseExer/paper/:exerId',
                    component: () => import('../views/myBaseExer/Paper.vue'),
                    meta: { title: '基础试题' },
                },
                {
                    path: '/myExam/paper/:examId',
                    component: () => import('../views/myExam/Paper.vue'),
                    meta: { title: '正式试卷' },
                },
                {
                    path: '/mockExam/paper/:examId',
                    component: () => import('../views/mockExam/Paper.vue'),
                    meta: { title: '模拟试卷' },
                },
                {
                    path: '/myCollect/paper/:exerId',
                    component: () => import('../views/myCollect/Paper.vue'),
                    meta: { title: '收藏试题' },
                },
                {
                    path: '/myErr/paper/:exerId',
                    component: () => import('../views/myErr/Paper.vue'),
                    meta: { title: '收藏试题' },
                },
                {
                    path: '/search/paper/:index/:name',
                    component: () => import('../views/search/Paper.vue'),
                    meta: { title: '搜索试题' },
                },
            ]
        },
       
    ]
})

export default router
